<%@page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8" %>
<%@include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>招聘职位列表</title>
    <jsp:include page="/common/layout_head.jsp"></jsp:include>
    <script src="${ctx}/js/activiti/workflow.js" type="text/javascript"></script>
    <script>
       
    </script>
</head>
<body>
<section class="main-content">
    <div class="content-wrap">
        <section class="panel panel-default">
            <div class="panel-heading">
                <b>招聘职位列表</b>
                <small class="pull-right">
                    <a href="javascript:window.location.reload();" class="pd-r-xs"><i class="fa fa-refresh"></i> 刷新</a>
                </small>
            </div>
            <div class="panel-body">
                <table class="table">
                    <thead>
                        <tr>
                            <th>部门</th>
                            <th>标题</th>
                            <th>更新时间</th>
                            <th>开始时间 -- 结束时间</th>
                            <th>当前节点</th>
                            <th>流程开始时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach items="${page.items}" var="leave" >
                            <c:set var="task" value="${leave.task }"/>
                            <c:set var="pi" value="${leave.processInstanceId }"/>
                            <tr>
                                <td>${leave.depName}</td>
                                <td>${leave.title}</td>
                                <td><fmt:formatDate pattern="YYYY/MM/dd HH:mm"  value="${leave.updateTime}" /></td>
                                <td><fmt:formatDate pattern="YYYY/MM/dd HH:mm"  value="${leave.createTime}" /> -- <fmt:formatDate pattern="YYYY/MM/dd HH:mm"  value="${leave.endTime}" /></td>
                                <td>
                                    <a href="javascript:;" class="trace"  pid="${pi}" pdid="${processDefinitionId}" title="点击查看流程图">${task.name }</a>
                                </td>
                                <td><fmt:formatDate pattern="YYYY/MM/dd HH:mm"  value="${task.createTime}" /></td>
                                <td>
                                	<c:if test="${empty pi }">
                                        <a href="javascript:;" url="${ctx }/oa/position/start/${leave.id}" data-info="启动?" class="ajax-get label label-info">启动招聘</a>
                                    </c:if>
                                    <c:if test="${task && empty task.assignee }">
                                        <a href="javascript:;" url="${ctx }/oa/task/claim/${task.id}" data-info="签收为我办理?" class="ajax-get label label-info">签收</a>
                                    </c:if>
                                    <c:if test="${task && not empty task.assignee }">
                                        <a href="javascript:;" url="${ctx }/oa/leave/task/complete/${task.id}" data-info="确认办理?" class="ajax-get label label-success">办理</a>

                                    </c:if>
                                </td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
                <div class="clearfix">
                    <div class="pull-right">
                        <mt:pager pageSize="${page.size}" pageNo="${page.index}" url="" recordCount="${page.totalRecord}" />
                    </div>
                </div>
            </div>
            </section>
        </div>
    </section>
</body>
</html>